import requests

proxy_api = 'http://123.56.42.142:5000/proxy/getitem/'
def get_random_proxy():
    # 动态从代理 API 获取代理 IP
    try:
        response = requests.get(proxy_api)
        proxy = response.json().get('proxy', None).get('http', None)
        return proxy
    except Exception as e:
        return None

if __name__ == '__main__':
    print(get_random_proxy())